package nio.niosocket;

import java.net.InetSocketAddress;
import java.nio.channels.ServerSocketChannel;

public class NIOServer {
    public static void main(String[] args) throws Exception {
        // 创建 ServerSocketChannel ，监听 8080 端口
        ServerSocketChannel ssc = ServerSocketChannel.open();
        ssc.socket().bind(new InetSocketAddress(8080));
        // 设置为非阻塞模式
        ssc.configureBlocking(false);
    }
}
